package ai.zixing.mediator02;

public class Client {
    public static void main(String[] args) {
        // set 方法是 MediatorStructure特有的，使用具体子类才能调用
//        Mediator mediator = new MediatorStructure();
        MediatorStructure mediator = new MediatorStructure();

        HouseOwner houseOwner = new HouseOwner("张三", mediator);
        Tenant tenant = new Tenant("李四", mediator);

        //中介收集房租和租房者信息
        mediator.setHouseOwner(houseOwner);
        mediator.setTenant(tenant);

        tenant.contact("需要一个两室一厅的房子,一家人住");
        houseOwner.contact("出租一套两室一厅带电梯,月租5000");
    }
}
